package cn.icanci.loopstack.ras.common.utils;

/**
 * @author icanci
 * @since 1.0 Created in 2023/01/19 20:51
 */
public class RandomAddressUtils {
    private RandomAddressUtils() {
    }

    /**
     * randomAddress、
     *
     * @param address address
     */
    public static void randomAddress(String[] address) {
        if (address.length == 1) {
            return;
        }
        int length = address.length;
        for (int i = 0; i < length; i++) {
            int iRandNum = (int) (Math.random() * length);
            String temp = address[iRandNum];
            address[iRandNum] = address[i];
            address[i] = temp;
        }
    }
}
